-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
12-g0rnn #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ๋ฌธ์ ๋ฅผ ํธ๋ ์์ด๋์ด๋ก ๋ค์๊ณผ ๊ฐ์ ์๋ฃจ์ ์ด ๋ ์ฌ๋์ต๋๋ค.
1. ๋ชจ๋ ์ฌ๋์ ์์์ ์ผ๋กํ๋ bfs ์งํ.
2. 1๋ฒ ์งํ์ค ๋ชจ๋ ๋
ธ๋๊ฐ ๋ฐฉ๋ฌธ๋์๋ค๋ฉด ๊ฐ์ฅ ๋ฉ๋ฆฌ์๋ ๋
ธ๋๊น์ง์ ๊ฑฐ๋ฆฌ ์ ์ฅ
3. ๊ฐ์ฅ ๋ฉ๋ฆฌ์๋ ๋
ธ๋๊น์ง์ ๊ฑฐ๋ฆฌ๋ค ์ค ๊ฐ์ฅ ์งง์ ๊ฒ ์ฐพ๊ธฐ
์ฒ์์๋ ๊ท ํธ๋ ์ฝ๋์ฒ๋ผ 1์ฉ ๊ฑฐ๋ฆฌ๋ฅผ ์ฆ๊ฐ์ํค๋ฉฐ bfs๋ฅผ ํ๋๋ฐ ๊ณ์ 4%์์ ํ๋ ธ๋ค๊ณ ๋จ๋๊ตฐ์,,
๊ทธ๋์ gpt์ ์๋์ ๋์์ ๋ฐ์์ต๋๋ค.
return *max_element(distances.begin(), distances.end());
์ด๋ ๊ฒ distance
๋ฐฐ์ด์ ๊ฑฐ๋ฆฌ๋ค์ ์ ์ฅํ๊ณ ๊ฐ์ฅ ํฐ๊ฐ์ ๋ฆฌํดํ๋๋ก ์์ ํ์ต๋๋ค.
์๋ ์ฝ๋
int bfs(vector<list<int>>& graph, int member) {
vector<bool> visited(N + 1, false);
queue<int> q;
q.push(member);
visited[member] = true;
int distance = 0;
while (!q.empty()) {
int size = q.size();
for (int i = 0; i < size; i++) {
int cur = q.front();
q.pop();
for (int curFriend : graph[cur]) {
if (!visited[curFriend]) {
q.push(curFriend);
visited[curFriend] = true;
}
}
}
distance++;
}
if (isConnected(visited)) return distance;
return -1;
}
๊ทธ๋ฆฌ๊ณ ๋๋จธ์ง ๋ถ๋ถ์ ๊ท ํธ๋๊ณผ ๋น์ทํฉ๋๋ค.
์ต์ข
๋ฐฐ์ด์ ์ต๋จ๊ฑฐ๋ฆฌ ๊ฐ๋ค๋ง ๋จ๊ธฐ๊ณ ๊ทธ๊ฒ๋ค์ ์ฌ๋ฐ๋ฅด๊ฒ ์ถ๋ ฅํ๋ ๋ฐฉ์์ผ๋ก ์งํํ์ต๋๋ค.
CPP CODE
#include <iostream>
#include <list>
#include <queue>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int N;
void printResult(vector<pair<int, int>>& result) {
cout << result[0].first << " " << result.size() << '\n';
for (auto& p : result) cout << p.second << " ";
}
int bfs(vector<list<int>>& graph, int member) {
vector<bool> visited(N + 1, false);
vector<int> distances(N + 1, 0);
queue<int> q;
q.push(member);
visited[member] = true;
while (!q.empty()) {
int cur = q.front();
q.pop();
for (int curFriend : graph[cur]) {
if (!visited[curFriend]) {
q.push(curFriend);
visited[curFriend] = true;
distances[curFriend] = distances[cur] + 1;
}
}
}
if (find(visited.begin() + 1, visited.end(), false) != visited.end()) return -1;
return *max_element(distances.begin(), distances.end());
}
int main() {
cin >> N;
vector<list<int>> graph(N + 1);
while (true) {
int a, b;
cin >> a >> b;
if (a == -1 && b == -1) break;
graph[a].push_back(b);
graph[b].push_back(a);
}
vector<pair<int, int>> result;
int minDistance = INT_MAX;
for (int i = 1; i <= N; i++) {
int distance = bfs(graph, i);
if (distance == -1) continue;
if (distance < minDistance) {
result.clear();
minDistance = distance;
}
if (distance == minDistance) result.emplace_back(minDistance, i);
}
if (!result.empty()) printResult(result);
return 0;
}
cpp ์ฐ์๋ ๋ถ์ ์ฝ๋ ํ ๋ฒ ์ ์ฝ์ด๋ณด์๋ฉด ๋์์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ง๊ธ๊น์ง ์ ๋ ์ ์์จ์๋ find
์ max_element
๋ฑ์ ํ์ฉํด๋ณด์์ต๋๋ค!!
(๊ทธ๋ฆฌ๊ณ emplace_back
๋ ์ฒ์ ํ์ฉํด๋ณด์์ต๋๋ค.)
๊ทธ๋ฆฌ๊ณ ๊ท ํธ๋์ด ์์ฑํ์ priority_queue
๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ์๋ ๋ง์ด ๊ณ ๋ฏผํด๋ดค์ต๋๋ค.
๊ทธ๋ฐ๋ฐ.. ๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๊ฐ ๋๋ ์ด์ ๋ ์ฐพ์ง ๋ชปํ์ต๋๋ค...
์ ๋ ๊ท ํธ๋ ์ค๋ช
์ฒ๋ผ ๋์ ๋ฐฐ์ด์ธ ๋ฒกํฐ๊ฐ ๋์ด๋๋ 128MB๋ฅผ ์ด๊ณผํ ์ ๋์ธ์ง ์ ๊ฐ๋ ์ด ์๋๋ค์..
์กฐ๊ธ ๋ ์์๋ณด๊ฒ ์ต๋๋ค.
์ด๋ฒ pr์ ์๊ฐํด๋ณผ ๊ฑฐ๋ฆฌ๊ฐ ๋ง์ ๊ฒ ๊ฐ๋ค์
์ข์ ๋ฌธ์ ๊ฐ์ฌํฉ๋๋ค ! !
/* | ||
for (int i = 1; i <= n; i++) { | ||
int score = bfs(i); | ||
candidate.emplace(score,i); | ||
} | ||
|
||
auto [point, who] = candidate.top(); | ||
candidate.pop(); | ||
president.push_back(who); | ||
|
||
while (candidate.top().first == point) { | ||
president.push_back(candidate.top().second); | ||
candidate.pop(); | ||
}*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๊ฐ ๋๋์ง ์์ง ์ ๋ชจ๋ฅด๊ฒ ๋ค์...
์ข ์ค๋ ๊ณ ๋ฏผํ๋๋ฐ๋ ๋ต์ด ์๋ค์
๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๊ฐ ์๋๋ผ๋ฉด ์ข์ ๋ก์ง์ธ ๊ฒ ๊ฐ์์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํน์ ์ฒ์ ์ฝ๋์์๋ mainํจ์๋ ๋ณํจ์ด ์๋์? ์ ๋ ์ ์๋๋์ง ์ด์ ๋ฅผ ์๊ฐํด๋ดค๋๋ฐ ํจ์๋ ์์๋ํ๋ ๊ฒ์ฒ๋ผ ๋ณด์ด๊ณ ์ ์ฝ๋๋ ๊ฑฐ์ ๊ฐ์๊ฑฐ ๊ฐ์์ main์์์ ์ค๋ฅ๊ฐ ์๋๊ฐ ์๊ฐ๋๋ค์
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์... ์ถ๋ ฅ์ ์๋ชปํ๋ค์...
์ ์ผ ์ฒซ ์ถ๋ ฅ์ด ํ์ฅ ํ๋ณด ์ ์
์ธ๋ฐ ์ ๋ ํ์ฅ ํ๋ณด ์ค ๊ฐ์ฅ ์ฒซ ๋
์์ ์ถ๋ ฅํ๊ณ ์์๋ค์.
( ํ
์คํธ ์ผ์ด์ค์์๋ ๋๋ค 2, 2 ๋ผ์ ๋ฐ๊ฒฌ์ด ์๋๋ค์)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ค ๊ทธ๋ฆฌ๊ณ ๊ท ํธ๋ ์ฐ์ ์์ ํ
๋ฒ์ ์ ์๋ฃจ์
๋ ์ด์ ๋ฅผ ์ฐพ์์ต๋๋ค!!
๋ค๋ฅธ ๊ณณ ํ๋๋ ์๊ฑด๋ค์๊ณ , ๋ฌธ์ ๋ ์ฌ๊ธฐ์์ต๋๋ค.
while (!candidate.empty() && candidate.top().first == point) {
president.push_back(candidate.top().second);
candidate.pop();
}
candidate
๊ฐ ๋น์ด์๋ ๊ฒฝ์ฐ๋ฅผ ์ปค๋ฒํ์ง ๋ชปํด์ ๋ฌดํ๋ฃจํ์ ๋น ์ก์๊ธฐ ๋๋ฌธ์ ๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๊ฐ ๋ฐ์ํ๋ ๊ฒ์ด๋ค์
ํ ์คํธ ์ผ์ด์ค๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
2
1 2
-1 -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ ์ด๋ฐ ์ค์๋ฅผ.. ํด๋น ๋ถ๋ถ์ ํ๋ ธ์๊ฑฐ๋ผ ์๊ฐ๋ ์ํ ๋ถ๋ถ์ด๋ผ ํผ์์๋ค๋ฉด ์ ๋ ๋ชป์ฐพ์์ ๊ฒ๋๋คใ ใ ์ฐพ์์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฌธ์ ๋ฅผ ์ฝ๋ค๋ณด๋ BFS๋ฌธ์ ์์ ์ ์ ์์์ต๋๋ค.
3๋ช ์ด๋ผ๋ฉด ์ฒซ์ฌ๋๋ถํฐ ๋์๊ฐ๋ฉฐ ๋๋จธ์ง ๋์ฌ๋๊ณผ์ ๊ด๊ณ์์ ์ผ๋ง๋๋จ์ด์ ธ์๋์ง ์๊ธฐ์ํด BFS๋ฅผ ์ฌ์ฉํ๋ฉด ๋๊ฒ ๋ค ์ถ์์ต๋๋ค.
์๋ฅผ๋ค์ด ์น๊ตฌ์ ์น๊ตฌ๊ฐ ์๋ ์ง์ ์ ์น๊ตฌ๋ฉด BFS 1ํ์ ์น๊ตฌ๋ ธ๋๊ฐ ์กํ๊ฒ์ ๋๋ค.
๊ทธ๋ฆฌ๊ณ ๋ง์ฝ ๋ชจ๋๊ฐ ์ง์ ์ ์ธ ์น๊ตฌ๋ผ๋ฉด, ์ฒซ BFS์ ๋ชจ๋ ๋ ธ๋๋ค์ด ๋ค ๋ค์ด์์ผ๊ฒ ์ฃ .
์ด๋ฅผ ๊ฐ ๋ ธ๋๋ค๊ฐ์ ๊ฑฐ๋ฆฌ๋ก ํ๋จํด ์ ๋ถ 1์ด๋ผ๋ฉด ํด๋น๋ ธ๋๋ 1์ ์ผ๋ก ๊ฐ์ฅ ๋ฎ์ ์ ์๋ฅผ ๋ฐ๊ฒ ๋ฉ๋๋ค.
from collections import deque
N = int(input())
friends = [[]for _ in range(N+1)]
while True:
a, b = map(int, input().split())
if a== -1 and b == -1:
break
friends[a].append(b)
friends[b].append(a)
def bfs(start):
dist = [-1] * (N + 1)
dist[start] = 0
queue = deque([start])
while queue:
current = queue.popleft()
for neighbor in friends[current]:
if dist[neighbor] == -1:
dist[neighbor] = dist[current] + 1
queue.append(neighbor)
return dist
scores = []
for i in range(1, N + 1):
dist = bfs(i)
max_dist = max([d for d in dist[1:] if d != -1])
scores.append((i, max_dist))
min_score = min(score for _, score in scores)
candidates = [member for member, score in scores if score == min_score]
print(min_score, len(candidates))
print(*sorted(candidates))
์ถ๊ฐ์ฌํญ
ํ์ด์ฌ์์ print(*sorted())๋ฅผ ์ฌ์ฉํ๊ฒ ๋๋ฉด ๋ฆฌ์คํธ์์ ๋ด์ฉ์ ๊ณต๋ฐฑ๊ธฐ์ค์ผ๋ก ํ์ด์ ์ถ๋ ฅํด์ค๋๋ค.
max_dist = max([d for d in dist[1:] if d != -1])๋ ๋ฆฌ์คํธ์ปดํ๋ฆฌํจ์
์ด๋ ๋ฌธ๋ฒ์
๋๋ค.
์ฆ 0๋ฒ์งธ ์ธ๋ฑ์ค๋ฅผ ์ ์ธํ๊ณ 1๋ถํฐ ๋๊น์ง ๋ฆฌ์คํธ์์ ๊ฐ์ ธ์ต๋๋ค. ๋ค๋ง if๋ฌธ์ผ๋ก -1์ด ์๋๊ฐ๋ง ๊ฐ์ ธ์ต๋๋ค. ๋ฌธ์ ์์ ์ด๋ป๊ฒ๋ ๋ค ์๋ ์ฌ์ด๋ผ ํ์ผ๋ ์ฌ์ค ํ์์๋ ๋ถ๋ถ์ด๊ธด ํฉ๋๋ค,,
ํ์ด๋ฅผ ์ฐพ์๋ณด๋ java code for (int k = 1; k <= n; k++) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
dist[i][j] = Math.min(dist[i][j], dist[i][k] + dist[k][j]);
}
}
}
int[] scores = new int[n+1];
int min = INF;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
scores[i] = Math.max(scores[i], dist[i][j]);
}
min = Math.min(min, scores[i]);
} ์ค๊ฐ ๋ ธ๋ k๋ฅผ ์ถ๊ฐํด๊ฐ๋ฉฐ i์์ j๋ก ๊ฐ๋ ์ต๋จ ๊ฑฐ๋ฆฌ๋ฅผ ๊ฐฑ์ ํฉ๋๋ค. scores[i]์๋ dist[i]์์์ ์ต๋๊ฐ์ ๋ฃ์ต๋๋ค. |
๐ ๋ฌธ์ ๋งํฌ
ํ์ฅ๋ฝ๊ธฐ
์๊ด์ 2025 ์ฒซ & 50๋ฒ์งธ pr์ ์ ๊ฐ ๊ฐ์ ธ๊ฐ๋๋ค^^
โ๏ธ ์์๋ ์๊ฐ
30m
โจ ์๋ ์ฝ๋
๋ฌธ์ ๋ฅผ ๊ฐ๋จํ ์์ฝํ๋ฉด ๋์๋ฆฌ์์ ๊ด๊ณ๋ฅผ ๊ทธ๋ํ๋ก ๋ํ๋ด๊ณ ๊ฐ ๋ ธ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ์ํํ๋ฉฐ ์ผ๋ง๋ ๊น์ ์ฐ๊ฒฐ์ ๊ฐ์ง๋์ง๋ฅผ ์ถ๋ ฅํ๋ ๋ฌธ์ ์ ๋๋ค.
๋จผ์ ๋์๋ฆฌ์์ ๊ทธ๋ํ๋ก ๋ํ๋ ๋๋ค. ์ ๋ 2์ฐจ์ ๋ฐฐ์ด์ ์ฌ์ฉํ์ฌ ๊ฐ๋จํ๊ฒ ๊ทธ๋ํ๋ฅผ ๊ตฌํํ์์ต๋๋ค.
bfs๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ๋ ธ๋(๋ชจ๋ ๋์๋ฆฌ์)๋ฅผ root๋ก ์ค์ ํ์ฌ ์ผ๋ง๋ ๊น์ ์ฐ๊ฒฐ์ ๊ฐ์ง๋์ง ํ์ธํ๊ณ level์ return ํฉ๋๋ค. ์ด ๋ถ๋ถ๋ ์ด๋ ต์ง ์์ ๊ฒ๋๋ค. ๋ง์ฝ ์ด๋ ต๋ค๋ฉด ์์ ํ ๋งํ ๋ฌธ์ ๋ฅผ ํ์ธํ๊ธธ...
์ด ๋ฌธ์ ๋ฅผ ํธ๋๋ฐ bfs๋ฅผ ์ฌ์ฉํ๋ค๊ณ ์ธ์งํ๊ณ ๊ตฌํํ๋ ๊ฒ์ ์ฝ๋ค๊ณ ์๊ฐํ์ง๋ง 2~3๋ฒ์ผ๋ก ๋์ด๊ฐ๋ ๋จ๊ณ๋ฅผ ๊ตฌํํ๋ ๊ฒ์ด ์ ์ผ ๋๊ด์ด๋ผ ์์๋ฉ๋๋ค.
์ ๋ ์ฒ์์ ๋ชจ๋ ๋ ธ๋๋ฅผ bfs๋ก ์ํํ๊ณ return ๊ฐ์
priority_queue
(์ต์ ์ฐ์ ์์ ํ)์ ์ฝ์ ํ์ฌ ์๋์ผ๋ก ์ ๋ ฌํ๊ณfront
์ ๊ฐ์ point๋ฅผ ๊ฐ์ง ์์๋ค์ ๋นผ๋ด์ด ์ ๋ต์ ์ถ๋ ฅํ๋ ค ํ์ต๋๋ค.๊ทผ๋ฐ ๋ฌด์จ ์ด์ ์์ ์ง ๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๊ฐ ๋จ๋๊ตฐ์.. gpt๋ฅผ ํตํด ์์๋ธ ๊ฒฐ๊ณผ
priority_queue
์ ๋ฐ์ดํฐ๋ฅผ ์ถ๊ฐํ ๋ ํ์ ์ฑ์ง์ ์ ์งํ๊ธฐ ์ํด ์์๋ค์ด ์ฌ๋ฐฐ์น ๋๊ณ ๋ด๋ถ์ ์ผ๋กsize
๊ฐ ๋์ด๋ ๋๋ง๋ค 2๋ฐฐ๋ก ๋์ด๋๋ ์ด ๋ ๋ฉ๋ชจ๋ฆฌ๊ฐ ์ด๊ณผ๋ ์ ์๋ค๊ณ ํ๋๊ตฐ์.cpp์์ ๋์ ๋ฐฐ์ด์ด๋ ๋ฐฐ์ด์ size๊ฐ ๋ด๊ฐ ๋ฃ์ ์์๋งํผ ๋์ด๋ฌ๋ค ์ค์ด๋๋ ๊ฒ์ฒ๋ผ ๋ณด์ด์ง๋ง ์ค์ ๋ด๋ถ์ ์ผ๋ก๋ ์ ํด์ง size๊ฐ ์๊ณ ์ด๋ฅผ ์ด๊ณผํ ๋๋ง๋ค
![image](https://private-user-images.githubusercontent.com/124599614/399744379-1aa9e9e1-30ac-46ba-9d56-988f4e41785c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzUwMTIsIm5iZiI6MTczODkzNDcxMiwicGF0aCI6Ii8xMjQ1OTk2MTQvMzk5NzQ0Mzc5LTFhYTllOWUxLTMwYWMtNDZiYS05ZDU2LTk4OGY0ZTQxNzg1Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMzI1MTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zODFmN2VhZGJhMTUyMGIxYjU0MWQ2YTY4M2IwNGZlNzVjM2FjMjY2ZGE5YmQ4ZTczZmRhOTliM2JjNjY3YWFlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-vyL-Pg-LpWzdGoO7ZoHi3R6ZyELTHV0jK1jkWJxTvU)
new
๋ฅผ ํตํด ๋ ํฐ size์ ๋ฐฐ์ด์ ๋ง๋ค๊ณ ๊ธฐ์กด ๋ฐฐ์ด์ ์ฝ์ ํ๊ฒ ๋ฉ๋๋ค. ์ด ๋ ์ ๊น์ด๋๋ง ๋ฐฐ์ด์ด ๋๊ฐ๋ ์๊ธฐ๊ฒ ๋๋ ๋ฉ๋ชจ๋ฆฌ๊ฐ ์ด๊ณผ๋ ์ ์๋ค๊ณ ํ๋๊ตฐ์. (๊ทผ๋ฐ ์๋ฌด๋ฆฌ ๊ทธ๋๋ n์ด 50์ธ๋ฐ 128MB ๋ณด๋ค ์ปค์ง ์ ์์๊น์?)๊ทธ๋์ ๋ฐฉ๋ฒ์ ๋ฐ๊พธ์ด bfs๋ฅผ ํตํด return ๋ฐ์ ๊ฐ ์ค ์์ ๊ฐ์ ๊ธฐ๋กํ ํ ๊ฐ์ ๋น๊ตํ์ฌ ์๋ฏธ์๋ ๊ฐ๋ค๋ง ์ถ๋ ค๋ธ ํ ์ ๋ต์ ์ถ๋ ฅํ์์ต๋๋ค.
๐ ์๋กญ๊ฒ ์๊ฒ๋ ๋ด์ฉ
์ฃผ์ ๋ถ๋ถ์ ์ ๊ฐ ์ฒ์ ์๊ฐํด๋ธ ์ฝ๋์ธ๋ฐ ๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๊ฐ ๋ฐ์ํ๋ ์ด์ ๊ฐ ์๋ฒฝํ ๋ฉ๋๋์ง ์์ ์๊ฒฌ์ ๋ฃ๊ณ ์ถ์ด ๋จ๊ฒจ ๋์์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ
auto [point, who]
๋ฅผ ๋ณด๋ฉด ์ ์ ์๋ cpp์์๋ ํ์ด์ฌ์ฒ๋ผ ๋๊ฐ์ง ๊ฐ์ ๋์์ ๋ฐ์ ์ ์๋๊ตฐ์. cpp17๋ถํฐ ์๊ฒผ๋ค๊ณ ํฉ๋๋ค.std::tuple, std::pair
๊ณผ ๊ฐ์ ๊ฒ์ ์ฌ์ฉํ ์ ์๋์!!